import draw.*;
import geometry.*;
import tester.*;
import tester.cobertura.Instrument;

import java.util.*;
import colors.*;

@Instrument
class ConsLot implements ITileList {
  /**
 * @uml.property  name="fst"
 * @uml.associationEnd  multiplicity="(1 1)"
 */
Tile fst;
  /**
 * @uml.property  name="rst"
 * @uml.associationEnd  multiplicity="(1 1)"
 */
ITileList rst;
  
  ConsLot(Tile fst, ITileList rst){
    this.fst = fst;
    this.rst = rst;
  }
  
  //Draws the list of tiles.
  public boolean draw(Canvas c){
    return this.fst.draw(c) && this.rst.draw(c);
  }
  
  //"map"s hitp across the list.
  public boolean hitp(Player p){
	  return fst.hitp(p) | rst.hitp(p);
  }
  
  //updates the whole list.
  public ITileList onTick(){
	  return new ConsLot(this.fst.onTick(), rst.onTick());
  }

  /*
  TEMPLATE:
     FIELDS:
      ... this.fst ...        --Tile
      ... this.rst ...        --ITileList
   
      METHODS:
      ... this.onTick() ...             -- Tile
      ... this.draw(Canvas c) ...       -- boolean
      ... this.hitp(Player p) ...       -- boolean

      METHODS FOR FIELDS:
      ... this.fst.onTick() ...             -- Tile
      ... this.fst.hitGroundp() ...         -- boolean
      ... this.fst.draw(Canvas c) ...       -- boolean
      ... this.fst.hitp(Player p) ...       -- boolean
      ... this.fst.distanceToX(Player p) ...-- double
      ... this.fst.distanceToY(Player p) ...-- double
      ... this.fst.center() ...             -- Posn
      ... this.rst.draw(Canvas c) ...       -- boolean
      ... this.rst.hitp(Canvas c) ...       -- boolean
      ... this.rst.onTick() ...             -- ITileList

  */ 
}